extends "../cTDR_5/cTDR_5.gd"
func _info():
	pass

func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "兽王"
	lv = 3
	attCoe.atkRan = 2
	attCoe.atk = 18 / 8.5 * 2 / 3
	attCoe.maxHp = 700 / 112.5 / 3
	var cd1 = 13
	if sys.test:cd1 = 2
	addCdSkill("sw",cd1)
	addSkillTxt("宠物2：开局召唤一只[鹰]/[猪]/[熊]")
	addSkillTxt("驯兽：召唤一只[鹰]/[猪]/[熊][cd:13秒]")

func _onBattleStart():
	._onBattleStart()
	var ids = str(sys.rndRan(1,3))
	var ncha = newChara("cex___Hide_pet" + ids,self.cell)
	if !ncha:
		var cells = utils.getAllyCells(team)
		for i in cells:
			ncha = newChara("cex___Hide_pet" + ids,i)
			if ncha:break
	if ncha:
		ncha.attInfo.maxHp += att.maxHp * 0.3
		ncha.attInfo.atk += att.atk * 0.5
		ncha.upAtt()
		ncha.plusHp(ncha.att.maxHp)

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "sw":
		cst("驯兽","000000",position)
		var ids = str(sys.rndRan(1,3))
		var ncha = newChara("cex___Hide_pet" + ids,self.cell)
		if !ncha:
			var cells = utils.getAllyCells(team)
			for i in cells:
				ncha = newChara("cex___Hide_pet" + ids,i)
				if ncha:break
		if ncha:
			ncha.attInfo.maxHp += att.maxHp * 0.3
			ncha.attInfo.atk += att.atk * 0.5
			ncha.upAtt()
			ncha.plusHp(ncha.att.maxHp)